<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    div {
      width: 20px;
      height: 30px;
      border: 1px solid red;
      position: relative;
    }

    div::after {
     content: "";
     width: 10px;
      height: 10px;
      position: absolute;
      top: 5px;
      right: 5px;
      border-right: 1px solid black;
      border-bottom: 1px solid black;
      transform: rotate(45deg);
      transition: all .2s;
    }

    /* 鼠标经过div 里面的三角旋转 ：原来是45，现在要旋转180，所以总的度数是两者之和” */

    div:hover::after {
      transform: rotate(180deg);
    }
  </style>
</head>

<body>
  <div>

  </div>
</body>

</html>